package com.three.sb_group3.service.impl;

import com.three.sb_group3.entity.Users;
import com.three.sb_group3.mapper.UsersMapper;
import com.three.sb_group3.service.UsersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service

public class UsersServiceimpl implements UsersService {
    @Resource
    private UsersMapper usersMapper;
    @Override
    public List<Users> userList() {
        List<Users> users = usersMapper.selectList(  null);
       return users;
    }

    @Override
    public List<Users> userEdit1() {
        Users user = new Users();
        user.setName1("acato");
        user.getPhone_number("85444");
        user.setEmail("8985@qq.com");
        user.getPassword("5847");
        int insert = usersMapper.insert(user);
        System.out.println(insert);
        return null;
    }

    @Override
    public List<Users> userDelete() {
        Users user = new Users();
        user.setId(3L);
        int delete = usersMapper.deleteById(3L);
        System.out.println(delete);
        return null;
    }

}
